package cn.wostore.wxhelper.Xposed;

import android.app.Activity;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;

/**
 * @author wuch
 * @date 2018/12/19 0019
 */
public class GetActivityHook extends XC_MethodHook {
    private final LoadHook loadHook;
    private final ClassLoader classLoader;

    GetActivityHook(LoadHook loadHook, ClassLoader classLoader) {
        this.loadHook = loadHook;
        this.classLoader = classLoader;
    }

    @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
        super.afterHookedMethod(param);
        if (this.loadHook.launcherUI == null) {
            XposedBridge.log("获取成功" + XSharedPrefrencesUtil.getInstance().getString("dbPassword", ""));
            this.loadHook.launcherUI = (Activity) param.thisObject;
            XposedBridge.log("微信主页获取成功" + this.loadHook.launcherUI.toString());
            this.loadHook.getGroupList(this.classLoader);
        }
    }
}
